﻿<%@ WebHandler Language="C#" Class="gridexport" %>

using System;
using System.Web;
using System.IO;
using System.Data;
using EasyFMS.Model;
using EasyFMS.Common;
using Liger.Data;

public class gridexport : IHttpHandler {
    public static DbContext DB = DbHelper.Db;
    
    public void ProcessRequest (HttpContext context) {
        DataSet excelSet = DB.ExecuteDataSet(context.Request["datasql"].ToString());
        ExcelHelper.ExportByWeb(excelSet.Tables[0], context.Request["sheetname"].ToString(), context.Request["filename"].ToString());
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}